<template>
<div>
  <el-dialog
    :title="title"
    :close-on-click-modal="false"
     v-dialogDrag
    :visible.sync="visible">
    <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
             label-width="120px">
      <el-row  :gutter="15">
        <el-col :span="12">
            <el-form-item label="设备名称" prop="basicdataCheckFacility"
                :rules="[
                 ]">
              <el-input v-model="names" placeholder="请填写设备"     disabled=""></el-input>

           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="部件名称" prop="basicdataCheckPart"
                :rules="[
                  {required: true, message:'部件名称不能为空', trigger:'blur'}
                 ]">
              <!-- <el-input v-model="inputForm.basicdataCheckPart" placeholder="请填写部位"     ></el-input> -->
              <el-select v-model="inputForm.basicdataCheckPart" placeholder="请选择部位" @change="handleChangeUnits" style="width:100%;" v-loading = 'isOneDropDownBoxLoading' :disabled=isOneDropDownBoxLoading>
               <el-option v-for="item in inputForm.partsData" :key="item.id" :label="'[' + item.code + ']' +item.name" :value="item.id" ref="units"></el-option>
              </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="零件名称" prop="basicdataCheckComponent"
                :rules="[
                 ]">
              <!-- <el-input v-model="inputForm.basicdataCheckComponent" placeholder="请填写零件"     ></el-input> -->
               <el-select v-model="inputForm.basicdataCheckComponent" placeholder="请选择零件" @change="handleChangePart" style="width:100%;" v-loading = 'isTwoDropDownBoxLoading' :disabled=isTwoDropDownBoxLoading>
                 <el-option v-for="item in inputForm.componentData" :key="item.id" :label= "'[' + ']' +item.name" :value="item.id" ref="part"></el-option>
               </el-select>
               </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="项目" prop="basicdataCheckProject"
                :rules="[
                  {required: true, message:'项目不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.basicdataCheckProject" placeholder="请填写项目"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="点检内容" prop="basicdataCheckContent"
                :rules="[
                  {required: true, message:'内容不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.basicdataCheckContent" placeholder="请填写内容"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="设备状态" prop="basicdataCheckStarus"
                :rules="[
                  {required: true, message:'设备状态不能为空', trigger:'blur'}
                 ]">
                    <el-radio-group v-model="inputForm.basicdataCheckStarus">
                        <el-radio v-for="item in $dictUtils.getDictList('device_state')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
                    </el-radio-group>
           </el-form-item>
        </el-col>
        <el-col>
    <el-divider content-position="left">点检模块</el-divider>
    </el-col>
        <el-col :span="24">
            <el-form-item label="点检分工" prop="basicdataCheckJob"
                :rules="[
                   {required: true, message:'点检分工人不能为空', trigger:'blur'}
                 ]">
                  <el-checkbox-group v-model="inputForm.basicdataCheckJob" >
                      <el-checkbox-button v-for="basicdataCheckJob in $dictUtils.getDictList('check_job')"  :label="basicdataCheckJob.value" :key="basicdataCheckJob.id">{{basicdataCheckJob.label}}</el-checkbox-button>
                  </el-checkbox-group>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="点检" prop="basicdataCheckCheck"
                :rules="[
                  {required: !isTwobutton, message:'点检不能为空', trigger:'blur'}
                 ]">
                 <el-input-number v-model="inputForm.basicdataCheckCheck" :min="0" :max="100" label="描述文字"  style="width:80%;" :disabled='isTwobutton' ></el-input-number>
              <el-select v-model="inputForm.basicdataCheckCheckUnit"  placeholder=""  style="width: 20%;" :disabled='isTwobutton'>
                        <el-option
                          v-for="item in $dictUtils.getDictList('basticdata_check_period')"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                        </el-option>
                    </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="点检责任人" prop="basicdataCheckCheckPeople.id"
                :rules="[
                   {required: !isTwobutton, message:'点检责任人不能为空', trigger:'blur'}
                 ]">
                <user-select :limit='1' :value="inputForm.basicdataCheckCheckPeople.id" @getValue='(value) => {inputForm.basicdataCheckCheckPeople.id=value}' :disabled='isTwobutton'></user-select>
           </el-form-item>
        </el-col>
        <el-col :span="24">
            <el-form-item label="点检初始时间" prop="basicdataCheckTime"
                :rules="[
                   {required: !isTwobutton, message:'点检初始时间不能为空', trigger:'blur'}
                 ]">
                <el-date-picker
                      :disabled='isTwobutton'
                      v-model="inputForm.basicdataCheckTime"
                      type="datetime"
                      style="width: 100%;"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间">
                    </el-date-picker>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="检修" prop="basicdataCheckFix"
                :rules="[
                  {required: !isThreebutton, message:'检修不能为空', trigger:'blur'}
                 ]">
                 <el-input-number v-model="inputForm.basicdataCheckFix" :min="0" :max="100" label="描述文字"  style="width:80%;" :disabled='isThreebutton'></el-input-number>
                <el-select v-model="inputForm.basicdataCheckFixUnit" placeholder=""  style="width: 20%;" :disabled='isThreebutton'>
                          <el-option
                            v-for="item in $dictUtils.getDictList('basticdata_check_period')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="检修责任人" prop="basicdataCheckFixPeople.id"
                :rules="[
                  {required: !isThreebutton, message:'检修责任人不能为空', trigger:'blur'}
                 ]">
                <user-select :limit='1' :value="inputForm.basicdataCheckFixPeople.id" @getValue='(value) => {inputForm.basicdataCheckFixPeople.id=value}' :disabled='isThreebutton'></user-select>
           </el-form-item>
        </el-col>
        <el-col :span="24">
            <el-form-item label="检修初始时间" prop="basicdataCheckFixTime"
                :rules="[
                  {required: !isThreebutton, message:'检修初始时间不能为空', trigger:'blur'}
                 ]">
                <el-date-picker
                      :disabled='isThreebutton'
                      v-model="inputForm.basicdataCheckFixTime"
                      type="datetime"
                      style="width: 100%;"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间">
                    </el-date-picker>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="岗位" prop="basicdataCheckPost"
                :rules="[
                  {required: !isOnebutton, message:'岗位不能为空', trigger:'blur'}
                 ]">
                 <el-input-number v-model="inputForm.basicdataCheckPost" :min="0" :max="100" label="描述文字"  style="width:80%;" :disabled='isOnebutton'></el-input-number>
                <el-select v-model="inputForm.basicdataCheckPostUnit" placeholder=""  style="width: 20%;" disabled=''>
                          <el-option
                            v-for="item in $dictUtils.getDictList('basicdata_ban')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="岗位责任人" prop="basicdataCheckPostPeople.id"
                :rules="[
                  {required: !isOnebutton, message:'岗位责任人不能为空', trigger:'blur'}
                 ]">
                <user-select  :value="inputForm.basicdataCheckPostPeople.id" @getValue='(value) => {inputForm.basicdataCheckPostPeople.id=value}' :disabled='isOnebutton'></user-select>
           </el-form-item>
        </el-col>
        <el-col :span="24">
            <el-form-item label="岗位初始时间" prop="basicdataCheckPostTime"
                :rules="[
                  {required: !isOnebutton, message:'岗位初始时间不能为空', trigger:'blur'}
                 ]">
                <el-date-picker
                      :disabled='isOnebutton'
                      v-model="inputForm.basicdataCheckPostTime"
                      type="datetime"
                      style="width: 100%;"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间">
                    </el-date-picker>
           </el-form-item>
        </el-col>
        <el-col :span="12">
              <el-form-item label="点检方法" prop="basicdataCheckMethod"
                  :rules="[
                      {required: true, message:'点检方法不能为空', trigger:'blur'}
                   ]">
                   <el-checkbox-group
                           v-model="inputForm.basicdataCheckMethod">
                          <el-checkbox-button v-for="basicdataCheckMethod in $dictUtils.getDictList('check_method')" :label="basicdataCheckMethod.value" :key="basicdataCheckMethod.id">{{basicdataCheckMethod.label}}</el-checkbox-button>
                 </el-checkbox-group></el-form-item>
             </el-form-item>
        </el-col>
        <el-col>
          <el-divider content-position="left"></el-divider>
          </el-col>
        <el-col :span="12">
            <el-form-item label="备注信息" prop="remarks"
                :rules="[
                 ]">
          <el-input type="textarea" v-model="inputForm.remarks" placeholder="请填写备注信息"     ></el-input>
           </el-form-item>
        </el-col>
    <el-col :span="24">
     <el-form-item label-width="0">
            <el-tabs v-model="basicdataCheckStandardMainTab">
            <el-tab-pane label="点检标准">
                  <el-button size="small" @click="addBasicdataCheckFormRow" type="primary">新增</el-button>
                  <el-table
                  border
                  :data="inputForm.basicdataCheckFormList.filter(function(item){ return item.delFlag !== '1'})"
                  style="width: 100%">
                <el-table-column
                    prop="checkCategory"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="类别">
                    <template slot-scope="scope">
                        {{ $dictUtils.getDictLabel("basicdata_category", scope.row.checkCategory, '-') }}
                    </template>
                  </el-table-column>
                  <el-table-column
                      prop="name"
                      header-align="center"
                      align="center"
                      show-overflow-tooltip
                      label="指标名称">
                    </el-table-column>
                <el-table-column
                    prop="checkUnit"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="计量单位">
                    <template slot-scope="scope">
                        {{ $dictUtils.getDictLabel("basicdata_symbol_measure", scope.row.checkUnit, '-') }}
                    </template>
                  </el-table-column>
                <el-table-column
                    prop="checkJudgeSymbol"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="判断符号">
                    <template slot-scope="scope">
                        {{ $dictUtils.getDictLabel("basicdata_symbol", scope.row.checkJudgeSymbol, '-') }}
                    </template>
                  </el-table-column>
                <el-table-column
                    prop="checkUp"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="上限">
                  </el-table-column>
                <el-table-column
                    prop="checkLimit"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="极限">
                  </el-table-column>
                <el-table-column
                    prop="checkJudge"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="是否手动">
                    <template slot-scope="scope">
                        {{ $dictUtils.getDictLabel("yes_no", scope.row.checkJudge, '-') }}
                    </template>
                  </el-table-column>
                <el-table-column
                    prop="checkContent"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="点检标准">
                  </el-table-column>
                <el-table-column
                    prop="remarks"
                    header-align="center"
                    align="center"
                    show-overflow-tooltip
                    label="备注信息">
                  </el-table-column>
                  <el-table-column
                    fixed="right"
                    label="操作"
                    width="150">
                    <template slot-scope="scope">
                      <el-button @click="viewBasicdataCheckFormRow(scope.row)" type="text" size="small">查看</el-button>
                      <el-button  @click="editBasicdataCheckFormRow(scope.row)" type="text" size="small">编辑</el-button>
                      <el-button  @click="delBasicdataCheckFormRow(scope.row)" type="text" size="small">删除</el-button>
                    </template>
                  </el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
           </el-form-item>
          </el-col>
        </el-row>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="close()">关闭</el-button>
      <el-button type="primary" v-if="method != 'view'" @click="doSubmit()" v-noMoreClick>确定</el-button>
    </span>
  </el-dialog>
  <!-- <BasicdataCheckFormForm ref="basicdataCheckFormForm" @addRow="saveBasicdataCheckFormRow(arguments)"></BasicdataCheckFormForm> -->
</div>
</template>

<script>
  // import BasicdataCheckFormForm from './BasicdataCheckFormForm'
  import UserSelect from '@/components/userSelect'
  export default {
    data () {
      return {
        title: '',
        method: '',
        visible: false,
        loading: false,
        basicdataCheckStandardMainTab: '0',
        inputForm: {
          id: '',
          basicdataCheckFormList: [],
          basicdataCheckFacility: '',
          basicdataCheckPart: '',
          basicdataCheckComponent: '',
          basicdataCheckProject: '',
          basicdataCheckContent: '',
          basicdataCheckStarus: '',
          basicdataCheckJob: [],
          basicdataCheckJobreturn: '',
          basicdataCheckTime: '',
          basicdataCheckFixTime: '',
          basicdataCheckPostTime: '',
          basicdataCheckCheck: '',
          unitName: '',
          basicdataCheckCheckUnit: 'D',
          partDevice: {
            id: '',
            code: '',
            name: ''
          },
          basicdataCheckCheckPeople: {
            id: ''
          },
          basicdataCheckFix: '',
          basicdataCheckFixUnit: 'D',
          basicdataCheckFixPeople: {
            id: ''
          },
          basicdataCheckPost: '',
          basicdataCheckPostUnit: 'S',
          basicdataCheckPostPeople: {
            id: ''
          },
          basicdataCheckMethod: [],
          basicdataCheckMethodreturn: [],
          remarks: '',
          partsData: [], // 部件数据
          componentData: [] // 零件数据
        },
        isOnebutton: true,
        isTwobutton: true,
        isThreebutton: true,
        parts: '', // 首级下拉框prop
        component: '', // 子级下拉框prop
        checkCheckValue: 0,
        checkFixValue: 0,
        checkPostValue: 0,
        isOneDropDownBoxLoading: false,
        isTwoDropDownBoxLoading: false,
        countfirst: 0,
        fileDevicename: '',
        names: ''
      }
    },
    components: {
      UserSelect
      // BasicdataCheckFormForm
    },
    watch: {
      // 监测设备名称编号变化(监听某个对象里面的某个固定属性时候所用如inputForm.partDevice.id)
      // 深度监听
      'inputForm.partDevice.id': function (newVal, oldVal) {
        this.parts = '' // 首级下拉框prop做清空处理
        this.component = '' // 子级下拉框prop做清空处理
        this.getNextNode(newVal)
      },
      //选择点检分工之后进行判断
      'inputForm.basicdataCheckJob': function (newVal, oldVal) {
         if (newVal.indexOf('1') !== -1) { // 检修
           this.isTwobutton = false
         } else {
           this.isTwobutton = true
           this.inputForm.basicdataCheckTime = ''
           this.inputForm.basicdataCheckCheck = ''
           this.inputForm.basicdataCheckCheckUnit = 'D'
           this.inputForm.basicdataCheckCheckPeople.id = ''
         }
         if (newVal.indexOf('2') !== -1) { // 点检
           this.isThreebutton = false
         } else {
           this.isThreebutton = true
           this.inputForm.basicdataCheckFixTime = ''
           this.inputForm.basicdataCheckFix = ''
           this.inputForm.basicdataCheckFixUnit = 'D'
           this.inputForm.basicdataCheckFixPeople.id = ''
         }
         if (newVal.indexOf('3') !== -1) { // 岗位
           this.isOnebutton = false
         } else {
           this.isOnebutton = true
           this.inputForm.basicdataCheckPostTime = ''
           this.inputForm.basicdataCheckPost = ''
           this.inputForm.basicdataCheckPostUnit = 'S'
           this.inputForm.basicdataCheckPostPeople.id = ''
         }
      },
      'inputForm.basicdataCheckComponent': function (newVal, oldVal) {
        this.productTypeReturn(newVal)
      },
      // 监测首级下拉框变化
      'inputForm.basicdataCheckPart': function (newVal, oldVal) {
        // 如果首级下拉框拿到了数据但还在视图加载，这里做了一个强行停止试图加载判断
        if (this.isOneDropDownBoxLoading === true) {
         this.isOneDropDownBoxLoading = false
        }
        if (newVal !== '') {
        this.dropDownBoxAssociated(newVal)
        }
      }
    },
    methods: {
      // 发送油品型号方法返回油品型号
      productTypeReturn (id) {
        this.$http({
          url: `/basicdata/basictree/partDeviceNode/queryById?id=${id}`,
          method: 'get'
        }).then(({ data }) => {
          this.inputForm.unitName = data.partDeviceNode.name
        })
      },
      // 选中下拉框所返回的函数
      handleChangeUnits (val) {
      // 传进来的val是select组件选中的value值，也就是一个fruitEnName
        var obj = {}
        obj = this.inputForm.partsData.find(function (item) {
          return item.fileCode === val
        })
        this.inputForm.basicdataCheckPart = '[' + obj.fileCode + ']' + obj.fileDevicename
      },
      // 选中下拉框所返回的函数
      handleChangePart (val) {
      // 传进来的val是select组件选中的value值，也就是一个fruitEnName
        var obj = {}
        obj = this.inputForm.componentData.find(function (item) {
          return item.fileCode === val
        })
        this.inputForm.basicdataCheckComponent = '[' + obj.fileCode + ']' + obj.fileDevicename
      },
      handleChangeCycle (val) {
        this.countOne = 1
      },
      handleChangereplacecycle (val) {
        this.countTwo = 1
      },
      // 获取下一层级节点
      // 需要传入想要获取下一级树的数据的父级id参数（比如传三级id此方法获取4级数据）
      getNextNode (presentNode) {
        this.isOneDropDownBoxLoading = true
        this.$http({
          url: `/basicdata/basictree/partDeviceNode/nextLevelTreeData`,
          method: 'get',
          params: {
            id: presentNode
          }
        }).then(({ data }) => {
          this.inputForm.partsData = data.data
          this.isOneDropDownBoxLoading = false
        })
      },
      close () {
        this.visible = false
        this.countfirst = 0
      },
      init (method, id) {
        this.countfirst = 0
        this.inputForm.componentData = ''
        this.inputForm.basicdataCheckPart = ''
        this.inputForm.basicdataCheckComponent = ''
        this.inputForm.basicdataCheckPostUnit = 'S'
        this.checkPostValue = 0
        this.checkCheckValue = 0
        this.checkFixValue = 0
        this.parts = '' // 首级下拉框prop做清空处理
        this.component = '' // 子级下拉框prop做清空处理
        this.isOnebutton = true
        this.isTwobutton = true
        this.isThreebutton = true
        this.method = method
        if (method === 'add') {
          this.title = `新建设备点检标准`
        } else if (method === 'edit') {
          this.title = '修改设备点检标准'
        } else if (method === 'view') {
          this.title = '查看设备点检标准'
        }
        this.visible = true
        this.loading = false
        this.$nextTick(() => {
          this.$refs.inputForm.resetFields()
          this.inputForm.id = id
          this.basicdataCheckStandardMainTab = '0'
          this.inputForm.basicdataCheckFormList = []
          if (method === 'edit' || method === 'view') { // 修改或者查看
            this.loading = true
            this.$http({
              url: `/basicdata/standard/basicdataCheckStandardMain/queryById?id=${this.inputForm.id}`,
              method: 'get'
            }).then(({data}) => {
              this.inputForm = this.recover(this.inputForm, data.basicdataCheckStandardMain)
              // this.inputForm.basicdataCheckJob = this.inputForm.basicdataCheckJobreturn.split(',')
              // this.inputForm.basicdataCheckMethod = this.inputForm.basicdataCheckMethodreturn.split(',')
              // this.checkFixValue = this.inputForm.basicdataCheckFix.substring(0, this.inputForm.basicdataCheckFix.length - 1)
              // this.inputForm.basicdataCheckFix = this.inputForm.basicdataCheckFix.substring(this.inputForm.basicdataCheckFix.length - 1)
              // this.checkCheckValue = this.inputForm.basicdataCheckCheck.substring(0, this.inputForm.basicdataCheckCheck.length - 1)
              // this.inputForm.basicdataCheckCheck = this.inputForm.basicdataCheckCheck.substring(this.inputForm.basicdataCheckCheck.length - 1)
              // this.checkPostValue = this.inputForm.basicdataCheckPost.substring(0, this.inputForm.basicdataCheckPost.length - 1)
              // this.inputForm.basicdataCheckPost = this.inputForm.basicdataCheckPost.substring(this.inputForm.basicdataCheckPost.length - 1)
              // this.inputForm.basicdataCheckFacility = '[' + partDevice.code + ']' + this.fileDevicename
              // 修改和查看需要执行下列两列回调赋值下拉框prop
              this.parts = this.inputForm.basicdataCheckPart
              this.component = this.inputForm.basicdataCheckComponent
              // this.getNextNode(partDevice.id)
              this.loading = false
            })
          }
        })
      },
      // 二级下拉框与一级下拉框关联方法(传的参数是一级下拉框的id值)
      dropDownBoxAssociated (newVal) {
        this.isTwoDropDownBoxLoading = true
        if (this.countfirst >= 1) {
          // this.component = ''
          this.inputForm.basicdataCheckComponent = ''
        } else {
          this.countfirst = this.countfirst + 1
        }
        this.$http({
          url: `/basicdata/basictree/partDeviceNode/nextLevelTreeData`,
          method: 'get',
          params: {
            id: newVal
          }
        }).then(({ data }) => {
          this.inputForm.componentData = data.data
          this.isTwoDropDownBoxLoading = false
        })
      },
      saveBasicdataCheckFormRow (child) {
        if (child[0] === '') {
          this.inputForm.basicdataCheckFormList.push(child[1])
        } else {
          this.inputForm.basicdataCheckFormList.forEach((item, index) => {
            if (item === child[0]) {
              this.inputForm.basicdataCheckFormList.splice(index, 1, child[1])
            }
          })
        }
      },
      addBasicdataCheckFormRow (child) {
        this.$refs.basicdataCheckFormForm.init('add', '', this.names)
      },
      viewBasicdataCheckFormRow (child) {
        this.$refs.basicdataCheckFormForm.init('view', child, this.names)
      },
      editBasicdataCheckFormRow (child) {
        this.$refs.basicdataCheckFormForm.init('edit', child, this.names)
      },
      delBasicdataCheckFormRow (child) {
        this.inputForm.basicdataCheckFormList.forEach((item, index) => {
          if (item === child && item.id === '') {
            this.inputForm.basicdataCheckFormList.splice(index, 1)
          } else if (item === child) {
            item.delFlag = '1'
            this.inputForm.basicdataCheckFormList.splice(index, 1, item)
          }
        })
      },
      // 表单提交
      doSubmit () {
        // this.inputForm.basicdataCheckCheck = this.checkCheckValue + this.inputForm.basicdataCheckCheck
        // this.inputForm.basicdataCheckFix = this.checkFixValue + this.inputForm.basicdataCheckFix
        // this.inputForm.basicdataCheckPost = this.checkPostValue + this.inputForm.basicdataCheckPost
        this.countfirst = 0
        this.inputForm.basicdataCheckFacility = this.fileDevicename
        this.$refs['inputForm'].validate((valid) => {
          if (valid) {
            this.loading = true
            this.$http({
              url: `/basicdata/standard/basicdataCheckStandardMain/save`,
              method: 'post',
              data: this.inputForm
            }).then(({data}) => {
              if (data && data.success) {
                this.visible = false
                this.$message.success(data.msg)
                this.$emit('refreshDataList')
              }
              this.loading = false
            })
          }
        })
      }
    }
  }
</script>
<style>
.el-checkbox-button.is-checked .el-checkbox-button__inner {
    color: #FFF;
    background-color: #0078F1 !important;
    border-color: #0078F1;
    -webkit-box-shadow: -1px 0 0 0 #66aef7;
    box-shadow: -1px 0 0 0 #66aef7;
}
</style>
